package repository;


import com.xgggh.redpack.domain.auth.Auth;
import com.xgggh.redpack.domain.auth.AuthReq;
import com.xgggh.redpack.domain.wallet.Wallet;

import javax.inject.Inject;

import io.reactivex.Flowable;
import model.Rsp;
import retrofit2.Retrofit;
import retrofit2.mock.MockRetrofit;
import service.OauthService;
import service.WalletService;


public class WalletRepository extends BaseRepository{

    @Inject
    public WalletRepository(Retrofit retrofit, MockRetrofit mockRetrofit) {
        this.retrofit = retrofit;
        this.mockRetrofit = mockRetrofit;
    }

    public Flowable<Rsp<Wallet>> getWallet() {
        return retrofit.create(WalletService.class)
                .getWallet()
                .compose(ioTransformer());
    }

    public Flowable<Rsp> putWallet(Wallet wallet) {
        return retrofit.create(WalletService.class)
                .putWallet(wallet)
                .compose(ioTransformer());
    }


}
